package com.gitee.wsl.mathematics.vector.bool.ext

import com.gitee.wsl.mathematics.number.compareTo
import com.gitee.wsl.mathematics.vector.vec3.Vector3
import com.gitee.wsl.mathematics.vector.bool.BooleanVector3


fun <T:Number> lessThan(a: Vector3<T,*>, b: T) = BooleanVector3(a.x < b, a.y < b, a.z < b)
fun <T:Number> lessThan(a: Vector3<T,*>, b: Vector3<T,*>) = BooleanVector3(a.x < b.x, a.y < b.y, a.z < b.z)
fun <T:Number> lessThanEqual(a: Vector3<T,*>, b: T) = BooleanVector3(a.x <= b, a.y <= b, a.z <= b)
fun <T:Number> lessThanEqual(a: Vector3<T,*>, b: Vector3<T,*>) = BooleanVector3(a.x <= b.x, a.y <= b.y, a.z <= b.z)
fun <T:Number> greaterThan(a: Vector3<T,*>, b: T) = BooleanVector3(a.x > b, a.y > b, a.z > b)
fun <T:Number> greaterThan(a: Vector3<T,*>, b: Vector3<T,*>) = BooleanVector3(a.x > b.y, a.y > b.y, a.z > b.z)
fun <T:Number> greaterThanEqual(a: Vector3<T,*>, b: T) = BooleanVector3(a.x >= b, a.y >= b, a.z >= b)
fun <T:Number> greaterThanEqual(a: Vector3<T,*>, b: Vector3<T,*>) = BooleanVector3(a.x >= b.x, a.y >= b.y, a.z >= b.z)
fun <T:Number> equal(a: Vector3<T,*>, b: T) = BooleanVector3(a.x == b, a.y == b, a.z == b)
fun <T:Number> equal(a: Vector3<T,*>, b: Vector3<T,*>) = BooleanVector3(a.x == b.x, a.y == b.y, a.z == b.z)
fun <T:Number> notEqual(a: Vector3<T,*>, b: T) = BooleanVector3(a.x != b, a.y != b, a.z != b)
fun <T:Number> notEqual(a: Vector3<T,*>, b: Vector3<T,*>) = BooleanVector3(a.x != b.x, a.y != b.y, a.z != b.z)

infix fun <T:Number> Vector3<T,*>.lt(b: T) = BooleanVector3(x < b, y < b, z < b)
infix fun <T:Number> Vector3<T,*>.lt(b: Vector3<T,*>) = BooleanVector3(x < b.x, y < b.y, z < b.z)
infix fun <T:Number> Vector3<T,*>.lte(b: T) = BooleanVector3(x <= b, y <= b, z <= b)
infix fun <T:Number> Vector3<T,*>.lte(b: Vector3<T,*>) = BooleanVector3(x <= b.x, y <= b.y, z <= b.z)
infix fun <T:Number> Vector3<T,*>.gt(b: T) = BooleanVector3(x > b, y > b, z > b)
infix fun <T:Number> Vector3<T,*>.gt(b: Vector3<T,*>) = BooleanVector3(x > b.x, y > b.y, z > b.z)
infix fun <T:Number> Vector3<T,*>.gte(b: T) = BooleanVector3(x >= b, y >= b, z >= b)
infix fun <T:Number> Vector3<T,*>.gte(b: Vector3<T,*>) = BooleanVector3(x >= b.x, y >= b.y, z >= b.z)
infix fun <T:Number> Vector3<T,*>.eq(b: T) = BooleanVector3(x == b, y == b, z == b)
infix fun <T:Number> Vector3<T,*>.eq(b: Vector3<T,*>) = BooleanVector3(x == b.x, y == b.y, z == b.z)
infix fun <T:Number> Vector3<T,*>.neq(b: T) = BooleanVector3(x != b, y != b, z != b)
infix fun <T:Number> Vector3<T,*>.neq(b: Vector3<T,*>) = BooleanVector3(x != b.x, y != b.y, z != b.z)

fun <T:Number> any(v: BooleanVector3) = v.x || v.y || v.z
fun <T:Number> all(v: BooleanVector3) = v.x && v.y && v.z